Kandria Combat System

This document describes the internals of how the combat and animation systems function. Kandria uses a combination of information provided natively by Aseprite, as well as an additional data file to describe extra per-animation and per-frame properties that the combat system needs to function.

For this reason, animation data is split across the following files:

For the most part you will be working within Aseprite and Kandria's editor. You should not have to modify the files manually often.

Combat Mechanics

Any character in the game can be in several internal states, though for the purpose of this system, we'll focus on "animated" and "normal" states. In the normal state, animation is controlled tightly by the game and changes in actions and animations can occur at any point. Animations that are used in the normal state don't need any combat data, only basic animation data.

Every animation regardless of state has two properties:

For animations that are used in the animated state, the movement of the character is no longer in the player's hands but is instead governed by per-frame motion data. The per-frame data contains the following attributes:

The animated state is used for attacks, getting hit, and dying.

In the player's case, animations can be buffered, meaning that the player can hit the button to initiate another animation while the current animation is playing. The buffered animation will play as soon as the current animation becomes cancelable or ends.

For general ideas about how the combat system is supposed to behave for the player, see the design document's combat section.

Combat Data Format

The x.lisp file that contains the animation data is formatted using standard Lisp syntax. It is structured using property lists:

Typically you will not want to edit this file manually and instead use the animation editor.

Exporting from Aseprite

When exporting from Aseprite to update animations, please choose "Export Sprite Sheet" with the following options:

You can also do this for most files in an automated fashion by just running the following from the Portacle REPL:

(kandria::compile-resources T T)